import { http } from '@/package_saleman/utils/request.js'

enum Urls {
	// storeList = 'mini/store/list',
	// salesmanWarehouse = 'mini/search/salesman_warehouse',
	regionList = 'salesman/search/regionList',
	storeList = 'salesman/store/list',
	storeCreate = 'salesman/store/add',
	storeEdit = 'salesman/store/edit',
	salesmanWarehouse = 'salesman/search/warehouse',
	settleStoreList = 'mini/settle/store_list',
	orderList = 'mini/settle/order_list',
	payOwe = 'mini/settle/pay_owe',
	payBalance = 'mini/settle/pay_balance',
	paymentList = 'mini/settle/payment_list',
	payZq = 'mini/settle/pay_zq',
	accountList = 'mini/account/list',
	warehouseEntrance = 'salesman/stock',
	transferList = 'salesman/transfer/list',
	transferAdd = 'salesman/transfer/add',
	transferEdit = 'salesman/transfer/edit',
	transferCancel = 'salesman/transfer/modify',
	transferMiddle = 'salesman/transfer/cart_list',
	transferMiddleDel = 'salesman/transfer/cart_del',
	transferMiddleAdd = 'salesman/transfer/cart',
	transferMiddleEdit = 'salesman/transfer/cart_edit',
	checkStock = 'salesman/order/is_stock_sufficient'
}
//判断库存
export const checkStock = (data) => http.post(Urls.checkStock, data)
// 片区列表
export const getRegion = () => http.get(Urls.regionList)
// 业务员端门店列表
export const storeList = (params) => http.get(Urls.storeList, params)
// 新增业务员门店
export const storeCreate = (params) => http.post(Urls.storeCreate, params)
// 修改业务员门店
export const storeEdit = (params) => http.post(Urls.storeEdit, params)
// 仓库列表-（主仓库、与该业务员绑定的移动仓库）
export const getWarehouseApi = (id ?: any) =>
	http.get(Urls.salesmanWarehouse, id ? { params: { id } } : {});
//库存列表
export const getWarehouseEntrance = (params) => http.get(Urls.warehouseEntrance, params)
// 门店列表
export const settleStoreList = (params) => http.get(Urls.settleStoreList, params)
// 调拨列表
export const getTransferList = (params) => http.get(Urls.transferList, params)
// 调拨购物车列表
export const getTransMiddle  = (params) => http.get(Urls.transferMiddle, params)
// 调拨购物车删除
export const delTransMiddle = (data) => http.post(Urls.transferMiddleDel, data)
// 调拨购物车新增
export const addTransferMiddle = (data) => http.post(Urls.transferMiddleAdd, data)
// 调拨购物车修改
export const editTransferMiddle = (data) => http.post(Urls.transferMiddleEdit, data)
// 新增调拨
export const transferAdd = (params) => http.post(Urls.transferAdd, params)
// 调拨编辑
export const transferEdit = (params) => http.post(Urls.transferEdit, params)
// 取消调拨单
export const transferCancel = (params) => http.post(Urls.transferCancel, params)
// 门店欠款订单列表
export const orderList = (params) => http.get(Urls.orderList, params)

// 门店欠款收款
export const payOwe = (data) => http.post(Urls.payOwe, data)

// 门店预存款收款
export const payBalance = (data) => http.post(Urls.payBalance, data)

// 账期账单列表
export const paymentList = (params) => http.get(Urls.paymentList, params)

// 账期结算
export const payZq = (data) => http.post(Urls.payZq, data)

//业务员对账
export const accountList = () => http.get(Urls.accountList)